<style>

    body {
        overflow: scroll;
    }
    .html{
        padding: 0 0 0 0 !important;
    }

    .table > thead > tr > th, .table > tbody > tr > td {
        white-space: nowrap;
    }

    .column-text{
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    .column-pickup_no{
        width: 200px;
        max-width: 200px;
        display: block;
    }
    .column-cycle{
        width: 10%;
        max-width: 10%;
    }
    .column-sku-psku_code{
        width: 10%;
        max-width: 10%;
    }
    .column-month{
        width: 60%;
        max-width: 60%;
        border: 1px solid #f4f4f4;
    }
    .column-seller_id{
        width: 10%;
        max-width: 10%;
        vertical-align: middle;
    }
    .column-created_at{
        width: 10%;
        max-width: 10%;
    }

    .pickup-span{
        padding: 2px;
        width: 32%;
        display: inline-block;
        border: 1px #f4f4f4 solid;
    }

</style>

<div>
    <table class="table table-hover grid-table">
        <thead>
        <tr>
            <th class="column-pickup_no">提货单号</th>
            <th class="column-cycle">期数</th>
            <th class="column-sku-psku_code">SKU</th>
            @for($i=0; $i< App\Models\SsBasic\StockupAreaSkuEstimate::NEW_ESTIMATE_NUM; $i++)
            <th class="column-month">{{ $i }}</th>
            @endfor
            <th class="column-created_at">更新时间</th>
            <th class="column-seller_id">提货员</th>
        </tr>
        </thead>

        <!--skuList-->
        @foreach($skuList as $row)
            <tr>
                <td class="column-pickup_no"></td>
                <td class="column-cycle" style="vertical-align: middle;">{{ $row->cycle }}</td>
                <td class="column-sku-psku_code"></td>
                <td class="column-month"></td>

                <?php $cycleSku = \App\Models\ProductPickup\PickupOrderLog::getCycleSku($row->pickup_no, $row->cycle); ?>
                @foreach($cycleSku as $key => $val)
                <tr style="border-right: 2px #ddd solid;border-bottom: 1px #f4f4f4 solid;">
                    <td class="column-pickup_no"></td>
                    <td class="column-cycle" style="vertical-align: middle;"></td>
                    <td class="column-sku-psku_code" style="vertical-align: middle;">{{ $val->sku->psku_code }}</td>

                    @for($i=1; $i<= App\Models\SsBasic\StockupAreaSkuEstimate::NEW_ESTIMATE_NUM; $i++)
                    <td class="column-month">
                        <div style="text-align: center;">{{ $val->month .$i }}</div>
                        <div>
                            <span class="pickup-span">提货数量</span>
                            <span class="pickup-span">发货数量</span>
                            <span class="pickup-span">发货箱数</span>
                        </div>
                        <div>
                            <span class="pickup-span">{{ $val->plan_num ?? 0 }}</span>
                            <span class="pickup-span">{{ $val->shipping_num ?? 0 }}</span>
                            <span class="pickup-span">{{ $val->shipping_box ?? 0 }}</span>
                        </div>
                    </td>
                    @endfor

                    <td class="column-created_at" style="vertical-align: middle;">{{ $row->created_at ?? '' }}</td>
                    <td class="column-seller_id" style="vertical-align: middle;">{{ App\Util\User::getUsernameById($row->seller_id) ?? '' }}</td>
                </tr>
                @endforeach
            </tr>
        @endforeach
    </table>
</div>

